<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src='./axios/index.js'></script>
    <!-- <script src="./node_modules/axios/dist/axios.js"></script> -->
    <script>
        axios.interceptor.request.use((config) => {
            console.log(1);
            return config;
            // return new Promise(resolve => {
            //     resolve(config);
            // })
        })
        axios.interceptor.request.use((config) => {
            console.log(2);
            return config;
            // return new Promise(resolve => {
            //     resolve(config);
            // })
        })
        axios.interceptor.request.use((config) => {
            console.log(3);
            return new Promise(resolve => {
                resolve(config);
            });
            // return new Promise(resolve => {
            //     resolve(config);
            // })
        })

        axios.interceptor.response.use((response) => {
            console.log(4);
        })
        axios.interceptor.response.use((response) => {
            console.log(5);
        })
        axios.interceptor.response.use((response) => {
            console.log(6);
        })
        axios({
            method: 'post',
            url: 'http://localhost:3000/user',
            // params: {
            //     name: 'hc',
            //     age: 18,
            //     sex: 'male'
            // },
            headers: {
                'name': 'hccc',
                'token': 'token'
            },
            data: {
                name: 'hlq',
                age: 19
            }
        })
        .then(data => {
            console.log(data);
        })


    </script>
</body>

</html>